<template>
	<view>
		<swiper class="swiper" :indicator-dots="true" :autoplay="true">
			<swiper-item v-for="item in list" :key="item.id">
				<view class="swiper-item" :style="{backgroundImage: 'url('+item.imgUrl+')'}">
				</view>
			</swiper-item>
		</swiper>
	</view>
</template>

<script>
	import {
		getBanner
	} from '../../../api/course-api.js'
	export default {
		data() {
			return {
				list: []
			}
		},
		created() {
			getBanner(3).then(res => {
				this.list = res.data.data
			})
		}
	}
</script>

<style>
	.swiper {
		height: 350rpx;
	}

	.swiper-item {
		height: 350rpx;
		background-size: cover;
		background-position: center;
		border-radius: 8px;
	}
</style>
